<extend name="Common/layout"/>
<block name="head_add">
    <script src="__STATIC__/plugin/uploadify/jquery.uploadify.js"></script>

    <script src="__STATIC__/plugin/yeditor/js/yeditor.js"></script>
    <link rel="stylesheet" href="__STATIC__/plugin/yeditor/css/yeditor.css">
</block>
<block name="body">
    <div class="panel">
        <div class="panel-heading">
            {$pannel_title}
        </div>
        <div class="panel-body">
            <ul id="myTab" class="nav nav-tabs">
                <volist name="group" id="config_group" key="group_id">
                    <li <eq name="key" value="0">class="active"</eq>><a href="#tab_{$config_group}" data-toggle="tab">{:C('CONFIG_GROUP')[$config_group]}</a></li>
                </volist>
            </ul>
            <form action="{:U('Config/update')}" method="post">
                <div id="myTabContent" class="tab-content">
                    <volist name="group" id="config_group" key="group_id">
                        <div class='tab-pane fade <eq name="key" value="0"> in active</eq>' id="tab_{$config_group}">
                            <div class="col-sm-10 col-md-9 col-lg-7">

                                    <volist name="configs" id="config" >
                                        <if condition="$config['group'] eq $config_group">
                                            <div class="form-group">
                                                <label for="{$config.name}">{$config.title} <span style="color:#b3b3b3;">{$config.illustration}</span></label>
                                                <switch name="config.type">
                                                    <case value="0">
                                                        <input type="text" class="form-control" id="{$config.name}" name="config[{$config.id}][value]" value="<if condition="isset($config['value'])">{$config.value}</if>">
                                                    </case>
                                                    <case value="1">
                                                        <input type="text" class="form-control" id="{$config.name}" name="config[{$config.id}][value]" value="<if condition="isset($config['name'])">{$config.value}</if>">
                                                    </case>
                                                    <case value="2">
                                                        <textarea id="{$config.name}" class="form-control" name="config[{$config.id}][value]" rows="5"><if condition="isset($config['name'])">{$config.value}</if></textarea>
                                                    </case>
                                                    <case value="3">
                                                        <textarea id="{$config.name}" class="form-control" name="config[{$config.id}][value]" rows="5"><if condition="isset($config['name'])">{$config.value}</if></textarea>
                                                    </case>
                                                    <case value="4">
                                                        <select class="form-control" name="config[{$config.id}][value]">
                                                            <YCx:volist name=":parse_config_attr($config['extra'])" id="vo">
                                                                <option value="{$key}" <eq name="config.value" value="$key">selected</eq>>{$vo}</option>
                                                            </YCx:volist>
                                                        </select>
                                                    </case>
                                                </switch>
                                                <input hidden="hidden" name="config[{$config.id}][id]" value="{$config.id}">
                                            </div>
                                        </if>
                                </volist>
                    <button type="submit" class="btn btn-default">提交</button>
                            </div>

                        </div>
                    </volist>
                </div>

            </form>
        </div>
    </div>
</block>